package Operation;

import Book.BookList;

import java.util.Scanner;

public class FindOperation implements IOperation{
    @Override
    public void work(BookList bookList) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入你要查询的书籍的名字：");
        String name = input.nextLine();
        for(int i = 0; i < bookList.getBookSize(); i++) {
            if (name.equals(bookList.getBook(i).getName())) {
                System.out.println(bookList.getBook(i));
            }
        }
        System.out.println("没有找到该书！！");
    }
}
